Diameter protocol, which uses stream control transmission protocol (Stream Control Transmission Protocol, referred to as SCTP) or transmission control protocol (Transmission Control Protocol, referred to as TCP) as an underlying protocol, is the protocol broadly applied in policy and charging control (Policy and Charging Control, referred to as PCC) architecture of the 3rd generation mobile communication technology network, and network of long term evolution (Long Term Evolution, referred to as LTE) and IMS, IP multimedia subsystem (IP Multimedia Subsystem, referred to as IMS) network. In the Diameter protocol, a Diameter routing agent (Diameter Routing Agent, referred to as DRA) provides the functionality of message routing of Diameter signaling, and the DRA is deployed for constructing a next generation signaling network.
In the signaling network, a message loop in a DRA is a major defect affecting regular services of the network. For preventing the message loop, it is required that a peer identity for a received message is added into a route-record (Route-Record) attribute value pair (Attribute Value Pair, referred to as AVP) of the received message, when a DRA forwards the received message. When the DRA receives a Diameter request message, it is checked firstly as to whether the Route-Record AVP of the request message has an identity of the DRA. If the Route-Record AVP of the request message has the identity of the DRA, it means a message loop occurs, and the DRA sends a response message of DIAMETER_LOOP_DETECTED. The response message is returned back to a client (Client) along the same route to inform the Client of a problem occurring at the route.
The above-mentioned method for detecting a message loop in the prior art can better detect a message loop among more than three DRA apparatuses. However, for a message loop between two DRA apparatuses, for example, a DRA 1 receives a Diameter request message sent by a Client, and sends the Diameter request message to a DRA 2, where an identity of the Client is added into the Route-Record AVP in the Diameter request message by the DRA 1. The DRA 2 then sends the Diameter request message to the DRA 1, where an identity of the DRA 1 is added into the Route-Record AVP in the Diameter request message. Upon the DRA 1 receives the Diameter request message, the DRA 1 detects that the Route-Record AVP in the Diameter request message has the identity of the DRA 1. Thus, the DRA 1 determines that a message loop occurs. It is required that the DRA 1 firstly return a response message of DIAMETER_LOOP_DETECTED to the DRA 2 along the same route, then the DRA 2 returns the response message of DIAMETER_LOOP_DETECTED to the DRA 1, and then the DRA 1 returns the response message of DIAMETER_LOOP_DETECTED to the Client. Processing efficiency for such a method for detecting a message loop between two DRA is low.